par(mfrow=c(2, 2))
data6_8 <- read.csv("data/习题数据（基于R，EXCEL格式）/csv/E6_8.csv")
ts_x <- ts(data6_8$x, frequency = 12, start=c(1980, 1))

# 时序图
plot(ts_x, type="o", pch=5, col='#39CBB4')


# 进行 Holt-Winters三参数指数平滑（加法模型）
x_fit2 <- HoltWinters(ts_x)
x_fit2
# 进行 Holt-Winters 三参数指数平滑，进行12期预测
# install.packages("forecast")
library(forecast)
x_fore <- forecast(x_fit2, h=60)
x_fore
# 预测效果图
plot(x_fore, lty=2)
lines(x_fore$fitted, col=4)

